
#pragma once

#include "wrapper_base.h"

#if defined(__GNUC__) || defined(__MINGW32__) || defined(__MINGW__)
    #pragma GCC diagnostic push
    #pragma GCC diagnostic ignored "-Wnon-virtual-dtor"
    #pragma GCC diagnostic ignored "-Weffc++"
#endif


namespace tools{
    namespace wrapper_detail{

    template<class T, size_t N> struct WrapperOperator: public WrapperBase<T, N>
    {
        WrapperOperator(): WrapperBase<T, N>() {}

        T* operator->()            { return this->GetResource();  }
        const T* operator->()const { return this->GetResource();  }

        operator T&()              { return *this->GetResource(); }
        operator const T&()const   { return *this->GetResource(); }

        T& operator*()             { return *this->GetResource(); }
        const T& operator*()const  { return *this->GetResource(); }
    };

    template<size_t N> struct WrapperOperator<void, N>: WrapperBase<void, N>
    {
        WrapperOperator(): WrapperBase<void, N>() {}

        void* operator->()            { return this->GetResource(); }
        const void* operator->()const { return this->GetResource(); }
    };

    }//namespace wrapper_details
}//namespace tools


#if defined(__GNUC__) || defined(__MINGW32__) || defined(__GNUC__)
    #pragma GCC diagnostic pop
#endif
